//
//  ShareDataHelper.m
//  Travel assistant
//
//  Created by lanou3g on 16/3/7.
//  Copyright © 2016年 旅游助手. All rights reserved.
//

#import "ShareDataHelper.h"
static ShareDataHelper *shareData = nil;
@implementation ShareDataHelper

+ (instancetype)shareDataHelper{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        shareData = [[ShareDataHelper alloc] init];
        shareData.weatherArray = [ShareDataHelper setWeatherDataWithWeatherImVsList];
    });
    return shareData;
}
+ (NSMutableArray *)setWeatherDataWithWeatherImVsList{
    NSArray *arr = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"WeatherImVsList" ofType:@"plist"]];
    NSMutableArray *muArray = [NSMutableArray array];
    for (NSDictionary *dic in arr) {
        WeatherModel *model = [[WeatherModel alloc] init];
        [model setValuesForKeysWithDictionary:dic];
        [muArray addObject:model];
    }
    return muArray;
}
@end
